Release 10.1A: OpenEdge Development:
Progress Dynamics Advanced Development
Setting up your test window
To illustrate the toolbar’s ability to control objects on multiple pages, you must create several pages in the window for the toolbar to control, including:
Toolbar and folder on Page 0
The first step is to add the basic toolbar and folder on Page 0.
![]()
To add the toolbar and folder:
- Use the
FolderPageToptoolbar, which has Update and Navigation buttons and also a standard File menu. There are in fact a variety of different built-in toolbars that you can investigate using the Toolbar and Menu Designer, or you can build a new one of your own.- Add an instance of the dynamic folder object, called
afspfoldw.w. When you add the folder to the window in the Container Builder, the tool creates aPagelink automatically from the folder to the window itself, since this is required for the folder to function properly.- In the Container Builder, choose the Page Maintenance tool, as shown:
![]()
- In the Page Maintenance window, add four folder tabs with the labels Customer, Maint, Orders, and OrderLine records, as shown:
![]()
Customer objects on Page 1
The next step is to put customer information on Page 1.
![]()
To add
Customerobjects on Page 1 of the window:
- Add a
CustomerSDO, such as thecustomerfullodynamic SDO that the Object Generator created for you.- Add a dynamic
Customerbrowser such as thecustomerfullbthat the Object Generator created, where the user can select aCustomerrecord to work with. There is also a viewer under the browser to display a selection of fields that might be helpful. You can build this dynamic viewer in the AppBuilder, selecting just the fields you want to see. In the example this viewer is calledcustcommentsv, since it features the Customer Comments field.- Add the following links:
- A
Navigationlink from the toolbar to theCustomerSDO on Page 1.- A
Datalink from the SDO to the browser on Page 1.- A
Datalink from the SDO to the viewer on Page 1. The viewer is just for data display purposes, so there is noTableIOlink to it and noUpdatelink back to the SDO.At this point, the window, which comes up with Page 0 and Page 1 displayed, should look like this:
![]()
Note the state of the toolbar buttons. The Next and Last Navigation buttons are enabled to show that the query is now positioned on the first record of the dataset. The Update buttons are all disabled because there is no object on the page that can do an update (and no
TableIOlink to communicate thoseUpdateevents through).Customer maintenance viewer on Page 2
The next step is to create an editable maintenance viewer on Page 2.
![]()
To add a Customer maintenance viewer:
- Add another
Customerviewer to Page 2. ForCustomermaintenance, start with the dynamiccustomerviewv,created by the Object Generator, open it, and rearrange the fields.- Add the following links:
- A
Datalink from theCustomerSDO to this viewer.- A
TableIO linkfrom the toolbar to the viewer.- An
Updatelink from the viewer to the SDO, so that users can add and maintainCustomersusing the viewer.Page 2 of the window looks like this:
![]()
Note that because the viewer is a
TableIO-Targetfor the toolbar and anUpdate-Sourcefor the SDO, the appropriate Update buttons in the toolbar are enabled.Order maintenance objects on Page 3
Page 3 of the window is for viewing and editing
Orders.
![]()
To add
Ordermaintenance objects:
- In the Container Builder, place the
OrderSDOorderfullo, the dynamic browserorderfullb, and the dynamic viewerorderviewvonto Page 3.- Edit the viewer in the AppBuilder to arrange the fields more appealingly.
- Add the following links:
- To enable the toolbar support for this page, define the following links:
Defining the Foreign Fields property for a child SDO
When you create a
Datalink fromCustomertoOrder, you must set theForeignFieldsproperty of theOrderSDO to identify which key is passed into theOrderSDO to qualify its query.
![]()
To define the ForeignFields property:
- Select the Order SDO in the Container Builder.
- To the immediate right of the Foreign Fields editor, click the button to bring up the Foreign Fields Mapping dialog box. This dialog box allows you to quickly map sources and targets.
- Map
Order.CustnumtoCustnum.This tells the framework that theOrderquery must be modified at run time to insert the phraseOrder.CustNum = <CustNum>, where<CustNum>represents the current value of the CustNum field in the parentCustomerSDO, as shown:
![]()
- Page 3 of your window should look like this:
![]()
OrderLine maintenance objects on Page 4
Page 4 is the
OrderLinepage.
![]()
To define
OrderLinemaintenance objects:
- Place the
OrderLineSDO orderlinfullo, theOrderLinebrowser orderlinfullb, and theOrderLineviewer orderlinviewv on this page.- Edit the viewer in the AppBuilder to rearrange the fields.
- Define these links:
- A
Datalink from theOrderSDO to theOrderLineSDO.- A
Datalink from theOrderLineSDO to theOrderLinebrowser.- A
Datalink from theOrderLineSDO to theOrderLineviewer.- A
TableIOlink from the toolbar to the viewer.- An
Updatelink from the viewer to the SDO.- A
Navigationlink from the toolbar to theOrderLineSDO.- Set the OrderLine SDO’s ForeignFields to OrderLine.OrderNum,OrderNum.
Modifying the resize attributes of a browser
Page 4 is sized to fit the overall size of the largest page when you run the window. Because there are typically only a few
OrderLinerecords perOrder, the browser might be taller than it needs to be, since by default it is sized to take up all available space on the page after the viewer, which is a fixed size, has been placed at the bottom.
![]()
To change this layout behavior:
- Make sure that the Resize Vertical toggle box is off in the Container Builder for the
OrderLinebrowser. This leaves it at its initial size regardless of the overall size of the folder, as shown:
![]()
- Set the MinHeight attribute in the dynamic property sheet to change the initial height, as shown:
Note: You can also modify the MinWidth and ResizeHorizontal attributes. You can set the ResizeHorizontal attribute to
![]()
FALSEand set theMinWidthof the browser in order to fix its width in the window so it is always the right size to display its fields.With the changes to MinHeight and ResizeVertical, Page 4 looks like this:
![]()
Summary of all the links for the window
The Container Builder’s Link Editor displays a summary of all the links you should have when you have completed these tasks, as shown:
![]()
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |